
<form class="form-horizontal" id="{{id}}" action="{{action}}" autocomplete="off">
<div id="form_elements_{{id}}">
{{#each elements}}

	{{#ifCond type '==' 'hidden'}}
		<input type="hidden" id="{{id}}" name="{{id}}" class="form-control" {{#if rule}} data-rule="{{rule}}" {{/if}}>
	{{/ifCond}}
	
	{{#ifCond type '==' 'text'}}
	<div class="col-sm-{{../../_sm_c}} col-md-{{../../_md_c}} col-lg-{{../../_lg_c}}" id="top_node_{{id}}">
		<div class="form-group {{#if required}}required{{/if}}">
		{{#if label}}
			<label class="col-md-4 col-sm-3 control-label">{{label}}</label>
			<div class="col-md-8 col-sm-9">
			{{else}}
			<div class="col-md-12 col-sm-12">
			
		{{/if}}
		{{#if btn}}
				<div class="input-group">
						<input id="{{id}}" name="{{id}}" class="form-control"{{#if rule}} data-rule="{{rule}}" {{/if}} {{#if placeholder}}placeholder="{{placeholder}}"{{/if}}>
						<span class="input-group-addon" id="{{id}}_click_btn"><span class="glyphicon {{btn}}"></span></span>
				</div>				
				{{else}}
				<input id="{{id}}" name="{{id}}" class="form-control"{{#if rule}} data-rule="{{rule}}" {{/if}} {{#if placeholder}}placeholder="{{placeholder}}"{{/if}}>
		{{/if}}
			</div>
		</div>
	</div>
	{{/ifCond}}
	
	{{#ifCond type '==' 'autocomplete'}}
	<div class="col-sm-{{../../_sm_c}} col-md-{{../../_md_c}} col-lg-{{../../_lg_c}}" id="top_node_{{id}}">
		<div class="form-group {{#if required}}required{{/if}}">
			{{#if label}}
			<label class="col-md-4 col-sm-3 control-label">{{label}}</label>
			<div class="col-md-8 col-sm-9">
			{{else}}
			<div class="col-md-12 col-sm-12">
			
		{{/if}}
				
				<input id="{{id}}_text" name="{{id}}_text" class="form-control" value="">
			</div>
		</div>
		<input type="hidden"  id="{{id}}" name="{{id}}" {{#if rule}} data-rule="{{rule}}" {{/if}}>
	</div>
	{{/ifCond}}	
	
	{{#ifCond type '==' 'password'}}
	<div class="col-sm-{{../../_sm_c}} col-md-{{../../_md_c}} col-lg-{{../../_lg_c}}" id="top_node_{{id}}">
		<div class="form-group {{#if required}}required{{/if}}">
			{{#if label}}
			<label class="col-md-4 col-sm-3 control-label">{{label}}</label>
			<div class="col-md-8 col-sm-9">
			{{else}}
			<div class="col-md-12 col-sm-12">
			
		{{/if}}
				<input type="password" id="{{id}}" name="{{id}}" class="form-control"{{#if rule}} data-rule="{{rule}}" {{/if}} {{#if placeholder}}placeholder="{{placeholder}}"{{/if}}>
			</div>
		</div>
	</div>
	{{/ifCond}}
	
	{{#ifCond type '==' 'date'}}
	<div class="col-sm-{{../../_sm_c}} col-md-{{../../_md_c}} col-lg-{{../../_lg_c}}" id="top_node_{{id}}">
		<div class="form-group {{#if required}}required{{/if}}">
			{{#if label}}
			<label class="col-md-4 col-sm-3 control-label">{{label}}</label>
			<div class="col-md-8 col-sm-9">
			{{else}}
			<div class="col-md-12 col-sm-12">
			
		{{/if}}
				<div class="input-group">
					<input class="form-control" id="{{id}}" name="{{id}}" type="text"{{#if rule}} data-rule="{{rule}}" {{/if}}>
				</div>
			</div>
		</div>
	</div>
	{{/ifCond}}
	
	{{#ifCond type '==' 'select'}}
	<div class="col-sm-{{../../_sm_c}} col-md-{{../../_md_c}} col-lg-{{../../_lg_c}}" id="top_node_{{id}}">
		<div class="form-group {{#if required}}required{{/if}}">
			{{#if label}}
			<label class="col-md-4 col-sm-3 control-label">{{label}}</label>
			<div class="col-md-8 col-sm-9">
			{{else}}
			<div class="col-md-12 col-sm-12">
			
		{{/if}}
				
				<!-- <select class="combobox form-control" name="{{id}}" id="{{id}}"{{#if rule}} data-rule="{{rule}}" {{/if}} {{#if defaultValue.value}}value="{{defaultValue.value}}"{{/if}}>
					<option value="" selected="selected">--请选择{{label}}--</option>
				</select> -->
				{{#if btn}}
					<div class="input-group">
							<input type="text" name="{{id}}" id="{{id}}"{{#if rule}} data-rule="{{rule}}" {{/if}} class="form-control">
							<span class="input-group-addon" id="{{id}}_click_btn"><span class="glyphicon {{btn}}" ></span></span>
					</div>				
					{{else}}
					<input type="text" name="{{id}}" id="{{id}}"{{#if rule}} data-rule="{{rule}}" {{/if}} class="form-control">
				{{/if}}
			</div>
		</div>
	</div>
	{{/ifCond}}
	
	<!-- <div class="col-sm-{{../../_sm_c}} col-md-{{../../_md_c}} col-lg-{{../../_lg_c}}">
		<div class="form-group {{#if required}}required{{/if}}">
			<label class="col-md-4 col-sm-4 control-label">popedit</label>
			<div class="col-md-8 col-sm-8">
				<div class="input-group">
					<input id="popedit" name="popedit" value="initPopedit" class="form-control" data-rule="required;">
				</div>
			</div>
		</div>
	</div> -->
	
	{{#ifCond type '==' 'multiselect'}}
	<div class="col-sm-{{../../_sm_c}} col-md-{{../../_md_c}} col-lg-{{../../_lg_c}}" id="top_node_{{id}}">
		<div class="form-group {{#if required}}required{{/if}}">
			{{#if label}}
			<label class="col-md-4 col-sm-3 control-label">{{label}}</label>
			<div class="col-md-8 col-sm-9">
			{{else}}
			<div class="col-md-12 col-sm-12">
			
		{{/if}}
				<select id="{{id}}" name="{{id}}" class="ui-multiselect form-control" {{#if placeholder}}data-placeholder="{{placeholder}}"{{/if}} {{#if rule}} data-rule="{{rule}}" {{/if}} 
					multiple="">
					<option value=""></option>
				</select>
			</div>
		</div>
	</div>
	{{/ifCond}}
	
	{{#ifCond type '==' 'spinner'}}
	<div class="col-sm-{{../../_sm_c}} col-md-{{../../_md_c}} col-lg-{{../../_lg_c}}" id="top_node_{{id}}">
		<div class="form-group {{#if required}}required{{/if}}">
			{{#if label}}
			<label class="col-md-4 col-sm-3 control-label">{{label}}</label>
			<div class="col-md-8 col-sm-9">
			{{else}}
			<div class="col-md-12 col-sm-12">
			
		{{/if}}
				<input id="{{id}}" name="{{id}}" class="form-control" data-rule="required">
			</div>
		</div>
	</div>
	{{/ifCond}}
	
	{{#ifCond type '==' 'underline'}}
	<div class="col-sm-{{../../_sm_c}} col-md-{{../../_md_c}} col-lg-{{../../_lg_c}}" id="top_node_{{id}}">
		<div class="form-group">
			{{#if label}}
			<label class="col-md-4 col-sm-3 control-label">{{label}}</label>
			<div class="col-md-8 col-sm-9">
			{{else}}
			<div class="col-md-12 col-sm-12">
			
		{{/if}}
				<input name="{{id}}" id="{{id}}">
			</div>
		</div>
	</div>
	{{/ifCond}}
	
	{{#ifCond type '==' 'searchbar'}}
	<div class="col-sm-{{../../_sm_c}} col-md-{{../../_md_c}} col-lg-{{../../_lg_c}}" id="top_node_{{id}}">
		<div class="form-group">
			{{#if label}}
			<label class="col-md-4 col-sm-3 control-label">{{label}}</label>
			<div class="col-md-8 col-sm-9">
			{{else}}
			<div class="col-md-12 col-sm-12">
			
		{{/if}}	
	 		<div class="input-group search-group" data-toggle="searchbar" id="{{id}}">
	 		{{#if btn}}
	 			<span class="input-group-addon" id="{{id}}_click_btn"><span class="glyphicon {{btn}}"></span></span>
	 		{{/if}}
	 		</div>
	 	</div>
		</div>
	</div>	
	 		
	{{/ifCond}}
	
	
	{{#ifCond type '==' 'link'}}
	<div class="col-sm-{{../../_sm_c}} col-md-{{../../_md_c}} col-lg-{{../../_lg_c}}" id="top_node_{{id}}">
		<div class="form-group">
			{{#if label}}
			<label class="col-md-4 col-sm-3 control-label">{{label}}</label>
			<div class="col-md-8 col-sm-9">
			{{else}}
			<div class="col-md-12 col-sm-12">
			
		{{/if}}
				<a href="#" id="{{id}}" name="{{id}}" class="underline-link">link</a>
			</div>
		</div>
	</div>
	{{/ifCond}}
	
	{{#ifCond type '==' 'checkbox'}}
	<div class="col-sm-{{../../_sm_c}} col-md-{{../../_md_c}} col-lg-{{../../_lg_c}}" id="top_node_{{id}}">
		<div class="form-group">
			{{#if label}}
			<label class="col-md-4 col-sm-3 control-label">{{label}}</label>
			<div class="col-md-8 col-sm-9">
			{{else}}
			<div class="col-md-12 col-sm-12">
			
		{{/if}}
				<label class="checkbox-inline"> <input type="checkbox" name="inlineCheckbox" id="inlineCheckbox1" value="option1" data-rule="checked"
					checked="true">1
				</label> <label class="checkbox-inline"> <input type="checkbox" name="inlineCheckbox" id="inlineCheckbox2" value="option2">2
				</label> <label class="checkbox-inline"> <input type="checkbox" name="inlineCheckbox" id="inlineCheckbox3" value="option3">3
				</label>
			</div>
		</div>
	</div>
	{{/ifCond}}
	
	{{#ifCond type '==' 'radio'}}
	<div class="col-sm-{{../../_sm_c}} col-md-{{../../_md_c}} col-lg-{{../../_lg_c}}" id="top_node_{{id}}">
		<div class="form-group">
			{{#if label}}
			<label class="col-md-4 col-sm-3 control-label">{{label}}</label>
			<div class="col-md-8 col-sm-9">
			{{else}}
			<div class="col-md-12 col-sm-12">
			
		{{/if}}
				<label class="radio-inline"> <input type="radio" name="inlineRadio" id="inlineRadio1" value="option1" data-rule="checked" checked="true">1
				</label> <label class="radio-inline"> <input type="radio" name="inlineRadio" id="inlineRadio2" value="option2">2
				</label> <label class="radio-inline"> <input type="radio" name="inlineRadio" id="inlineRadio3" value="option3">3
				</label>
			</div>
		</div>
	</div>
	{{/ifCond}}
	
	{{#ifCond type '==' 'switch'}}
	<div class="col-sm-{{../../_sm_c}} col-md-{{../../_md_c}} col-lg-{{../../_lg_c}}" id="top_node_{{id}}">
		<div class="form-group {{#if required}}required{{/if}}">
			{{#if label}}
			<label class="col-md-4 col-sm-3 control-label">{{label}}</label>
			<div class="col-md-8 col-sm-9">
			{{else}}
			<div class="col-md-12 col-sm-12">
			
		{{/if}}
				<input name="{{id}}" id="{{id}}" type="checkbox" class="switchbutton">
			</div>
		</div>
	</div>
	{{/ifCond}}
	
	{{#ifCond type '==' 'textarea'}}
	<div class="col-sm-{{../../_sm_c}} col-md-{{../../_md_c}} col-lg-{{../../_lg_c}}" id="top_node_{{id}}">
		<div class="form-group {{#if required}}required{{/if}}">
		{{#if label}}
			<label class="col-md-4 col-sm-4 control-label">{{label}}</label>
			<div class="col-md-8 col-sm-8 clear-white">
			{{else}}
			<div class="col-md-12 col-sm-12 clear-white">			
		{{/if}}
				<textarea id="{{id}}" name="{{id}}" class="form-control" {{#if rule}} data-rule="{{rule}}" {{/if}}></textarea>
			</div>
		</div>
	</div>
	{{/ifCond}}
	
	{{#ifCond type '==' 'upload'}}
	<div class="col-md-12 col-sm-12" id="top_node_{{id}}">
		<div class="form-group">
			<label class="col-md-2 col-sm-4 control-label">{{label}}</label>
			<div class="col-md-10 col-sm-8">
				<div class="input-group">
					<input name="file_{{id}}" value="" class="form-control" readonly="readonly"> <span class="input-group-addon fileinput-container">
						<div class="fileinput-pick">
							<i class="glyphicon glyphicon-level-up"></i>
						</div> <input type="file" id="{{id}}" class="fileinput-input" multiple="">
					</span>
				</div>
			</div>
		</div>
	</div>
	{{/ifCond}}
	
	{{#ifCond type '==' 'editText'}}
	<div class="col-md-12 col-sm-12" id="top_node_{{id}}">
		<div class="form-group">
			<label class="col-md-2 col-sm-4 control-label">{{label}}</label>
			<div class="col-md-10 col-sm-8">
				<textarea name="{{id}}" id="{{id}}"></textarea>
			</div>
		</div>
	</div>
	{{/ifCond}}
	{{/each}}
	</div>
</form>